package demo.topic16;

import demo.topic15.Color;

import java.util.Arrays;

@ClassAnnotation(name="小橘猫", color= Color.YELLOW, like={"鱼", "鸡腿", "猫粮"})
public class Cat {
    private String name;

    private int age;

    private Color color;

    private String[] like;

    public Cat() {
    }

    public Cat(String name, int age, Color color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    /**
     * 方法注解
     * @param name
     */
    @MethodAnnotation
    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    public String[] getLike() {
        return like;
    }

    public void setLike(String[] like) {
        this.like = like;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", color=" + color +
                ", like=" + Arrays.toString(like) +
                '}';
    }
}
